package com.blog.backend.controller;

import com.blog.backend.domain.BlogInfo;
import com.blog.backend.domain.DTO.BlogDTO;
import com.blog.backend.service.BlogService;
import com.blog.common.core.domain.R;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author:Auman Time：2024/5/10 11:13
 */
@Api(tags = "博客搜索引擎controller")
@RequestMapping("/search")
@RestController
public class BlogSearchController {

    @Autowired
    private BlogService service;

    @RequestMapping("/info")
    public R<List<BlogInfo>> searchByInfo(BlogDTO dto) {
        return R.ok(service.searchByInfo(dto));
    }

    @RequestMapping("/queryByes")
    public R<List<BlogInfo>> queryByes(BlogDTO dto) {
        return R.ok(service.getByTitle7Content(dto));
    }

}
